package lion.dev.lang;

/**
 * @author lion
 * @mail hl_0074@sina.com
 * @date 2011-8-30
 */
public class Lang {

	@SuppressWarnings("unchecked")
	public static <T> T nvl(T... objects) {

		if (objects == null) { return null; }

		for (T o : objects) {
			if (o != null) { return o; }
		}
		return null;
	}

	public static String join(int[] arrs) {

		StringBuilder sbu = new StringBuilder();
		for (Object o : arrs) {
			sbu.append(o + "").append(",");
		}
		return sbu.toString().replaceAll(",$", "");
	}
}
